package com.team5.menuservice.service.impl;

import com.team5.menuservice.entity.Permission;
import com.team5.menuservice.mapper.PermissionMapper;
import com.team5.menuservice.service.PermissionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
@Service
public class PermissionServiceImpl implements PermissionService {
    @Autowired
    PermissionMapper permissionMapper;

    @Override
    public List<Permission> selectmenu() {
        List<Permission> selectmenu = permissionMapper.selectmenu();
        return selectmenu;
    }

    @Override
    public List<Permission> selectAll() {
        List<Permission> select = permissionMapper.selectAll();
        return select;
    }

    @Override
    public List<Permission> select(String title,Integer index,Integer limit) {
        // TODO 自动生成的方法存根
        List<Permission> select = permissionMapper.select(title,index, limit);
        return select;
    }

    @Override
    public List<Permission> select2(String percode,String title,Integer index,Integer limit) {
        // TODO 自动生成的方法存根
        List<Permission> select = permissionMapper.select2(percode,title,index, limit);
        return select;
    }

    @Override
    public void insert(Integer pid, String title, String icon, String href, String target, Integer open,
                       Integer ordernum, Integer available) {
        // TODO 自动生成的方法存根
        permissionMapper.insert(pid, title, icon, href, target, open, ordernum, available);
    }

    @Override
    public void delete(Integer id) {
        // TODO 自动生成的方法存根
        permissionMapper.delete(id);
    }

    @Override
    public void update(Integer id, Integer pid, String title, String icon, String href, String target, Integer open,
                       Integer ordernum, Integer available) {
        // TODO 自动生成的方法存根
        permissionMapper.update(id, pid, title, icon, href, target, open, ordernum, available);
    }

    @Override
    public List<Permission> selectPermission() {
        // TODO 自动生成的方法存根
        List<Permission> selectPermission = permissionMapper.selectPermission();
        return selectPermission;
    }

    @Override
    public void insert2(Integer pid,String title, String percode, Integer open,
                        Integer ordernum, Integer available) {
        // TODO 自动生成的方法存根
        permissionMapper.insert2(pid, title, percode, open, ordernum, available);
    }

    @Override
    public List<Permission> selectPid(Integer pid) {
        // TODO 自动生成的方法存根
        List<Permission> selectPid = permissionMapper.selectPid(pid);
        return selectPid;
    }
}
